package com.holyant.report.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Map;

/**
 * 每日应收dto
 *
 * @author fkmalls
 * @date 2022-11-21
 */
@Data
@ApiModel("每日应收")
public class RptDailyReceivableReportDto implements Comparable<RptDailyReceivableReportDto> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "业务线")
    private String channel;
    @ApiModelProperty(value = "业务模式")
    private String channel2rd;
    @ApiModelProperty(value = "客户")
    private String customerName;
    @ApiModelProperty(value = "平台")
    private String platform;
    @ApiModelProperty(value = "店铺名称")
    private String shopName;
    @ApiModelProperty(value = "币种")
    private String currency;
    @ApiModelProperty(value = "帐期")
    private Integer accountPeriod;
    @ApiModelProperty(value = "催款负责人")
    private String promptOwnerName;
    @ApiModelProperty(value = "升级负责人")
    private String upgradeName;
    @ApiModelProperty(value = "合计帐期")
    private Integer accountDays;
    @ApiModelProperty(value = "累计销售额")
    private BigDecimal sumSalesAmount;
    @ApiModelProperty(value = "日期应收")
    private Map<String, BigDecimal> daily;

    @Override
    public int compareTo(RptDailyReceivableReportDto o) {
        int c = (channel != null ? channel : "").compareTo((o.channel != null ? o.channel : ""));
        if (c != 0) {
            return c;
        }
        int p = (platform != null ? platform : "").compareTo((o.platform != null ? o.platform : ""));
        if (p != 0) {
            return p;
        }
        int s = (shopName != null ? shopName : "").compareTo((o.shopName != null ? o.shopName : ""));
        if (s != 0) {
            return s;
        }
        return (customerName != null ? customerName : "").compareTo((o.customerName != null ? o.customerName : ""));
    }
}
